package acm.pta15;

import java.io.*;
import java.util.*;

public class 斯德哥火车上的题 {
    static ArrayList<Character> solve(String str) {
        char s[] = str.toCharArray();
        int n = str.length();

        ArrayList<Character> res = new ArrayList<Character>();
        for (int i = 1; i < n; i++) {
            if (s[i] % 2 == s[i - 1] % 2)
                res.add((char) Math.max(s[i], s[i - 1]));
        }
        return res;
    }

    static void print(ArrayList<Character> res) {
        for (int i = 0; i < res.size(); i++)
            out.print(res.get(i));
        out.println();
    }

    static boolean equals(ArrayList<Character> A, ArrayList<Character> B) {
        int n = A.size(), m = B.size();
        if (n != m)
            return false;
        for (int i = 0; i < n; i++) {
            if (A.get(i) != B.get(i))
                return false;
        }
        return true;
    }

    public static void main(String[] args) {
        String a = sc.next(), b = sc.next();

        ArrayList<Character> A = solve(a), B = solve(b);

        print(A);
        if (!equals(A, B))
            print(B);
        out.flush();
    }

    static Scanner sc = new Scanner(System.in);
    static PrintWriter out = new PrintWriter(System.out);
}


